'''
''' Updates a record in the table.
'''
Public Shared Sub UpdateRecord()
' Get an existing record with ID 1.
Dim rec As New ${${Table Name}RecordClassName}
' Set second parameter to True in GetRecord() to retrieve an updatable record.
rec = ${${Table Name}ClassName}.GetRecord("1", True )
' Update the fields of the record as shown below.
' EmployeesRecord.LastName = "LastName"
' EmployeesRecord.FirstName = "FirstName"
' Save the update.
rec.Save()
' Example shown below shows the transaction handling.
' Note that you need to start a transaction before calling
' UpdateRecord() function.
' Try
' DbUtils.StartTransaction()
' UpdateRecord()
' DbUtils.CommitTransaction()
' Me.DataChanged=True
' Catch ex As Exception
' DbUtils.RollBackTransaction()
' Utils.MiscUtils.RegisterJScriptAlert(Me, "UNIQUE_SCRIPTKEY", ex.Message)
' Finally
' DbUtils.EndTransaction()
' End Try
End Sub
|